package cn.wolfcode.luowowo.search.service;

import cn.wolfcode.luowowo.search.query.GoldProductSearchQuery;
import cn.wolfcode.luowowo.search.query.IndexSearchQuery;
import cn.wolfcode.luowowo.search.template.GoldProductTemplate;
import cn.wolfcode.luowowo.search.template.TravelTemplate;
import cn.wolfcode.luowowo.search.vo.StaticVo;
import org.springframework.data.domain.Page;
import org.springframework.data.elasticsearch.core.aggregation.AggregatedPage;

import java.util.List;

/**
 * @author 猫教授
 * @date 2019/8/18 17:17
 */
public interface IGoldProductSearchService {
    /**
     * 保存或者修改
     * @param tt
     */
    void save(GoldProductTemplate tt);

    /**
     * 字段查询
     * @param qo
     * @param fieldName
     * @return
     */
    AggregatedPage<GoldProductTemplate> selectByKeyword(GoldProductSearchQuery qo, String... fieldName);

    /**
     * 分组查询分类显示之大分类
     * @param parentTypeId
     * @param parentTypeName
     * @return
     */
    List<StaticVo> selectGroupByParentType(String parentTypeId, String parentTypeName);

    /**
     * 分组查询之显示小分类
     * @param typeId
     * @param typeName
     * @return
     */
    List<StaticVo> selectGroupByType(String typeId, String typeName,GoldProductSearchQuery qo);

    /**
     * 排序查询
     * @param qo
     * @return
     */
    Page<GoldProductTemplate> selectOrderBy(GoldProductSearchQuery qo);

    /**
     * 用大分类查询并排序
     * @param qo
     * @return
     */
    Page<GoldProductTemplate> selectOrderByParentTypeId(GoldProductSearchQuery qo);

    /**
     * 用小分类查询并排序
     * @param qo
     * @return
     */
    Page<GoldProductTemplate> selectOrderByTypeId(GoldProductSearchQuery qo);

    /**
     * 去es查询出数组
     * @param content
     * @return
     */
    String[] searchArrays(String content);
}
